﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.DAO;

namespace WF.BusinessObject
{
    public class Attachment : Com.DAO.BusinessEntiry
    {
        public Attachment(DataManager dataManager) : base(dataManager, "dbo.Attachment", "ID")
        {

        }

        public static int GetAttachementNum(string kqapplyID, DataManager dataManager)
        {
            int rtn = 0;
            string sql = "";
            sql = sql + "Select Count(1) From Attachment With(Nolock) Where EntityID='" + kqapplyID + "'";
            string num = dataManager.SelectScalar(sql).ToString();
            if(!string.IsNullOrEmpty(num))
            {
                rtn = Convert.ToInt32(num);
            }

            return rtn;
        }
    }
}
